<!DOCTYPE html>



  


<html class="theme-next pisces use-motion" lang="zh-Hans">
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="UTF-8">
<!-- modify by zhangwei -->
<!-- 百度站长 -->
<meta name="baidu-site-verification" content="MdPKZBgY0U">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">



  <meta name="google-site-verification" content="8DKRuNxJDPU2k6cNyVhLe_eSqGk-R8oiYk8iKMg5gwI">














  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/uploads/favicon.ico?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/uploads/favicon.ico?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/uploads/favicon.ico?v=5.1.4">


  <link rel="mask-icon" href="/uploads/favicon.ico?v=5.1.4" color="#222">





  <meta name="keywords" content="gradle,JFrog,Artifactory,">





  <link rel="alternate" href="/atom.xml" title="班德尔城" type="application/atom+xml">






<meta name="description" content="JFrog的Artifactory是一款Maven仓库服务端软件，可以用来在内网搭建maven仓库，供团队、公司内部公共库的上传和发布以及使用，以提高公共代码使用的便利性。 个人Library仓库使用：传送门">
<meta name="keywords" content="gradle,JFrog,Artifactory">
<meta property="og:type" content="article">
<meta property="og:title" content="Artifactory搭建本地JFrog的Library仓库">
<meta property="og:url" content="https://tiimor.cn/Artifactory搭建本地JFrog的Library仓库/index.html">
<meta property="og:site_name" content="班德尔城">
<meta property="og:description" content="JFrog的Artifactory是一款Maven仓库服务端软件，可以用来在内网搭建maven仓库，供团队、公司内部公共库的上传和发布以及使用，以提高公共代码使用的便利性。 个人Library仓库使用：传送门">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="http://cdn.tiimor.cn/images/JFrog_Artifactory.jpg">
<meta property="og:image" content="http://cdn.tiimor.cn/images/Artifactory%E7%9B%AE%E5%BD%95.png">
<meta property="og:image" content="http://cdn.tiimor.cn/images/Artifactory%E8%BF%90%E8%A1%8C%E6%88%90%E5%8A%9F.png">
<meta property="og:image" content="http://cdn.tiimor.cn/images/%E6%89%93%E5%BC%80%E6%9C%AC%E5%9C%B0%E4%BB%93%E5%BA%93.png">
<meta property="og:image" content="http://cdn.tiimor.cn/images/Artifactory%E7%99%BB%E5%BD%95%E6%88%90%E5%8A%9F.png">
<meta property="og:image" content="http://cdn.tiimor.cn/images/gradle%E4%BB%93%E5%BA%93.png">
<meta property="og:image" content="http://cdn.tiimor.cn/images/ArtifactoryLibraryModule.png">
<meta property="og:image" content="http://cdn.tiimor.cn/images/Artifactory%E4%B8%8A%E4%BC%A0.png">
<meta property="og:image" content="http://cdn.tiimor.cn/images/Artifactory%E4%B8%8A%E4%BC%A0%E6%88%90%E5%8A%9F.png">
<meta property="og:image" content="http://cdn.tiimor.cn/images/Artifactory%E4%BF%9D%E5%AF%86%E4%B8%8A%E4%BC%A0.png">
<meta property="og:image" content="http://cdn.tiimor.cn/images/Artifactory%E6%9B%B4%E6%96%B0%E7%89%88%E6%9C%AC.png">
<meta property="og:image" content="http://cdn.tiimor.cn/images/Artifactory%E5%BC%95%E7%94%A8%E4%BE%9D%E8%B5%96.png">
<meta property="og:updated_time" content="2019-03-17T06:47:42.376Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Artifactory搭建本地JFrog的Library仓库">
<meta name="twitter:description" content="JFrog的Artifactory是一款Maven仓库服务端软件，可以用来在内网搭建maven仓库，供团队、公司内部公共库的上传和发布以及使用，以提高公共代码使用的便利性。 个人Library仓库使用：传送门">
<meta name="twitter:image" content="http://cdn.tiimor.cn/images/JFrog_Artifactory.jpg">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Pisces',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":true,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '3AUIZWGETM',
      apiKey: '5fcd6d51d892fffe3480c5b37f5fd4fa',
      indexName: 'Tiimor',
      hits: {"per_page":8},
      labels: {"input_placeholder":"搜索","hits_empty":"未发现与「${query}」相关的内容","hits_stats":"${hits} 条相关条目，使用了 ${time} 毫秒"}
    }
  };
</script>



  <link rel="canonical" href="https://tiimor.cn/Artifactory搭建本地JFrog的Library仓库/">





  <title>Artifactory搭建本地JFrog的Library仓库 | 班德尔城</title>
  




<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
  ga('create', 'UA-96457043-1', 'auto');
  ga('send', 'pageview');
</script>


  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?abb97f8f68c9e5eb2217d3111c64e696";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>




</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

  <!-- modify by zhangwei -->
  <!-- 下雪的动画 -->
  <div class="canvas-snow">
    <canvas id="canvas" style="margin: 0;  padding: 0;top:0; left: 0; right: 0; background: transparent; position: absolute;" width="1366" height="105"></canvas>
      <script>

      var canvasBgImg = {
        start: function () {
          this.canvas = document.getElementById('canvas')
          this.ctx = this.canvas.getContext("2d")
          this.canvas.width = window.innerWidth
          this.canvas.height = 105
          this.starList = []
        },
        drawLine: function (ctx, x1, y1, x2, y2) {
          ctx.beginPath()
          ctx.strokeStyle = '#ffffff'
          ctx.lineTo(x1, y1)
          ctx.lineTo(x2, y2)
          ctx.stroke()
        },
        canvasSingleSnow: function (snowSize) {
          var singleSnow = document.createElement('canvas'),
            ctxSingle = singleSnow.getContext('2d')
          singleSnow.setAttribute('width', snowSize * 2)
          singleSnow.setAttribute('height', snowSize * 2)
          for (var i = 0; i < 6; i++) {
            ctxSingle.save()
            ctxSingle.translate(snowSize, snowSize)
            ctxSingle.rotate(Math.PI * 2 * i / 6)
            this.drawLine(ctxSingle, 0, 0, snowSize, 0)
            ctxSingle.restore()
          }
          return singleSnow
        },
        canvasAllSnow: function (centerSnow) {
          var canvasSnow = document.createElement('canvas'),
            ctxSnow = canvasSnow.getContext('2d'),
            bigSnow = this.canvasSingleSnow(centerSnow),
            smallSnow = this.canvasSingleSnow(centerSnow / 3),
            sizeSnow = centerSnow * 3 / 5,
            rSnow = centerSnow - sizeSnow / 2
          canvasSnow.setAttribute('width', centerSnow * 2)
          canvasSnow.setAttribute('height', centerSnow * 2)
          ctxSnow.drawImage(bigSnow, 0, 0, bigSnow.width, bigSnow.height, 0, 0, centerSnow * 2, centerSnow * 2)
          for (var i = 0; i < 6; i++) {
            ctxSnow.save()
            ctxSnow.translate(centerSnow, centerSnow)
            ctxSnow.rotate(Math.PI * 2 * i / 6)
            ctxSnow.drawImage(smallSnow, 0, 0, smallSnow.width, smallSnow.height, rSnow - sizeSnow / 2,
              -sizeSnow / 2, sizeSnow, sizeSnow)
            ctxSnow.restore()
          }
          return canvasSnow
        },
        init: function () {
          this.start()
          for (var i = 0; i < 75; i++) {
            this.starList.push({
              drawFunc: this.canvasAllSnow(15),
              width: Math.random() * this.canvas.width,
              height: Math.random() * this.canvas.height,
              speed: Math.random() * 1.5 + .5,
              scale: Math.random() * 12 + 5,
              angel: 0
            })
          }
          var self = this,
            loop = function () {
              self.ctx.clearRect(0, 0, self.canvas.width, self.canvas.width)
              for (var i = 0; i < 75; i++) {
                self.ctx.save()
                self.starList[i].height = self.starList[i].height + self.starList[i].speed
                self.starList[i].angel += 2
                self.ctx.translate(self.starList[i].width, self.starList[i].height)
                self.ctx.rotate(self.starList[i].angel * Math.PI / 360)
                self.ctx.translate(-self.starList[i].width, -self.starList[i].height)
                self.ctx.drawImage(self.starList[i].drawFunc, 0, 0,
                  self.starList[i].drawFunc.width, self.starList[i].drawFunc.height,
                  self.starList[i].width - self.starList[i].scale / 2,
                  self.starList[i].height - self.starList[i].scale / 2,
                  self.starList[i].scale, self.starList[i].scale)
                if (self.starList[i].height > self.canvas.height) {
                  self.starList[i] = Object.assign(self.starList[i], {
                    height: -self.starList[i].scale,
                    width: Math.random() * this.canvas.width
                  })
                }
                self.ctx.restore()
              }
              requestAnimationFrame(loop)
            }
          requestAnimationFrame(loop)
        }
      }
      canvasBgImg.init()
      </script>

    </div>


    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <!-- modify by zhangwei -->
        <!-- 圣诞帽 -->
        <img src="/uploads/santa-hat.png" id="santa" style="height: 41px; position: absolute; left: -40px; top: -20px; transform: rotate(-45deg); z-index: 9000;">

        <span class="logo-line-before"><i></i></span>
        <span class="site-title">班德尔城</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">微笑，简单，奋发</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br>
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br>
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br>
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br>
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-guestbook">
          <a href="/guestbook" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-send"></i> <br>
            
            留言
          </a>
        </li>
      
        
        <li class="menu-item menu-item-favourite">
          <a href="/favourite" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-bookmark"></i> <br>
            
            收藏
          </a>
        </li>
      

      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="popup-trigger">
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br>
            
            搜索
          </a>
        </li>
      
    </ul>
  

  
    <div class="site-search">
      
  
  <div class="algolia-popup popup search-popup">
    <div class="algolia-search">
      <div class="algolia-search-input-icon">
        <i class="fa fa-search"></i>
      </div>
      <div class="algolia-search-input" id="algolia-search-input"></div>
    </div>

    <div class="algolia-results">
      <div id="algolia-stats"></div>
      <div id="algolia-hits"></div>
      <div id="algolia-pagination" class="algolia-pagination"></div>
    </div>

    <span class="popup-btn-close">
      <i class="fa fa-times-circle"></i>
    </span>
  </div>




    </div>
  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://tiimor.cn/Artifactory搭建本地JFrog的Library仓库/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Tiimor">
      <meta itemprop="description" content>
      <meta itemprop="image" content="/uploads/avatar.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="班德尔城">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">Artifactory搭建本地JFrog的Library仓库</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2017-05-21T16:37:55+08:00">
                2017-05-21
              </time>
            

            

            
          </span>

          
            <span class="post-category">
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/攻城狮/" itemprop="url" rel="index">
                    <span itemprop="name">攻城狮</span>
                  </a>
                </span>

                
                
                  ， 
                
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/攻城狮/好好学习/" itemprop="url" rel="index">
                    <span itemprop="name">好好学习</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
              <span class="post-comments-count">
                <span class="post-meta-divider">|</span>
                <span class="post-meta-item-icon">
                  <i class="fa fa-comment-o"></i>
                </span>
                <a href="/Artifactory搭建本地JFrog的Library仓库/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count gitment-comments-count" data-xid="/Artifactory搭建本地JFrog的Library仓库/" itemprop="commentsCount"></span>
                </a>
              </span>
            
          

          
          
             <span id="/Artifactory搭建本地JFrog的Library仓库/" class="leancloud_visitors" data-flag-title="Artifactory搭建本地JFrog的Library仓库">
               <span class="post-meta-divider">|</span>
               <!-- modify by zhangwei -->
               <!-- 去掉阅读的眼睛图标，阅读次数改为℃ -->
			   
                 <span class="post-meta-item-text">热度 </span>
               
                 <span class="leancloud-visitors-count"></span>
				 <span>℃</span>
             </span>
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <p><img src="http://cdn.tiimor.cn/images/JFrog_Artifactory.jpg" alt="JFrog_Artifactory"></p>
<p>JFrog&#x7684;Artifactory&#x662F;&#x4E00;&#x6B3E;Maven&#x4ED3;&#x5E93;&#x670D;&#x52A1;&#x7AEF;&#x8F6F;&#x4EF6;&#xFF0C;&#x53EF;&#x4EE5;&#x7528;&#x6765;&#x5728;&#x5185;&#x7F51;&#x642D;&#x5EFA;maven&#x4ED3;&#x5E93;&#xFF0C;&#x4F9B;<strong>&#x56E2;&#x961F;&#x3001;&#x516C;&#x53F8;&#x5185;&#x90E8;</strong>&#x516C;&#x5171;&#x5E93;&#x7684;&#x4E0A;&#x4F20;&#x548C;&#x53D1;&#x5E03;&#x4EE5;&#x53CA;&#x4F7F;&#x7528;&#xFF0C;&#x4EE5;&#x63D0;&#x9AD8;&#x516C;&#x5171;&#x4EE3;&#x7801;&#x4F7F;&#x7528;&#x7684;&#x4FBF;&#x5229;&#x6027;&#x3002;</p>
<p><strong>&#x4E2A;&#x4EBA;Library&#x4ED3;&#x5E93;&#x4F7F;&#x7528;&#xFF1A;<a href="http://tiimor.cn/AndroidStudio%E5%8F%91%E5%B8%83Library%E5%88%B0jCenter/">&#x4F20;&#x9001;&#x95E8;</a></strong></p>
<a id="more"></a>
<h1 id="&#x642D;&#x5EFA;&#x73AF;&#x5883;"><a href="#&#x642D;&#x5EFA;&#x73AF;&#x5883;" class="headerlink" title="&#x642D;&#x5EFA;&#x73AF;&#x5883;"></a>&#x642D;&#x5EFA;&#x73AF;&#x5883;</h1><ul>
<li>JFrog&#x63D0;&#x4F9B;&#x514D;&#x8D39;&#x5E76;&#x5F00;&#x6E90;&#x7684;Artifactory&#x73AF;&#x5883;&#x5305;&#xFF0C;&#x4E0B;&#x8F7D;<a href="https://api.bintray.com/content/jfrog/artifactory/jfrog-artifactory-oss-%24latest.zip;bt_package=jfrog-artifactory-oss-zip" target="_blank" rel="noopener">Artifactory</a>&#xFF0C;&#x76EE;&#x524D;&#x4E0B;&#x8F7D;&#x7684;&#x662F;5.3.0&#x7248;&#x672C;&#xFF0C;&#x5B98;&#x7F51;&#xFF1A;<a href="https://www.jfrog.com" target="_blank" rel="noopener">https://www.jfrog.com</a></li>
<li>&#x7CFB;&#x7EDF;&#x73AF;&#x5883;&#xFF1A;Windows&#x3001;Linux</li>
<li>&#x5B89;&#x88C5;Java&#x73AF;&#x5883;&#xFF0C;&#x5E76;&#x4E14;JDK&#x7248;&#x672C;1.8+</li>
</ul>
<h1 id="&#x542F;&#x52A8;&#x670D;&#x52A1;"><a href="#&#x542F;&#x52A8;&#x670D;&#x52A1;" class="headerlink" title="&#x542F;&#x52A8;&#x670D;&#x52A1;"></a>&#x542F;&#x52A8;&#x670D;&#x52A1;</h1><p>&#x4E24;&#x79CD;&#x542F;&#x52A8;&#x65B9;&#x5F0F;&#xFF1A;<strong><a href="https://www.jfrog.com/confluence/display/RTF/Installing+on+Windows#InstallingonWindows-ManualInstallation" target="_blank" rel="noopener">&#x5B98;&#x7F51;&#x542F;&#x52A8;&#x65B9;&#x5F0F;&#x8BB2;&#x89E3;</a></strong></p>
<h2 id="Manual-Installation"><a href="#Manual-Installation" class="headerlink" title="Manual Installation"></a>Manual Installation</h2><ul>
<li><p>&#x89E3;&#x538B;&#x4E0B;&#x8F7D;&#x6587;&#x4EF6;&#xFF0C;&#x8FDB;&#x5165;<code>artifactory-oss-5.3.0\bin\</code>&#x76EE;&#x5F55;&#xFF0C;Window&#x73AF;&#x5883;&#x53CC;&#x51FB;artifactory.bat&#x6587;&#x4EF6;&#xFF1B;Linux&#x73AF;&#x5883;&#x6267;&#x884C;artifactory.sh&#x6587;&#x4EF6;<br><img src="http://cdn.tiimor.cn/images/Artifactory%E7%9B%AE%E5%BD%95.png" alt="Artifactory&#x76EE;&#x5F55;" title="Artifactory&#x76EE;&#x5F55;&#x7ED3;&#x6784;"></p>
</li>
<li><p>&#x6267;&#x884C;&#x6587;&#x4EF6;&#x540E;&#xFF0C;&#x7B49;&#x5F85;Artifactory&#x5F00;&#x542F;&#xFF0C;&#x8FD0;&#x884C;&#x6210;&#x529F;<strong>&#xFF08;&#x6CE8;&#x610F;&#x4E0D;&#x80FD;&#x5173;&#x95ED;&#x542F;&#x52A8;&#x670D;&#x52A1;&#x7684;&#x63A7;&#x5236;&#x53F0;&#xFF0C;&#x5426;&#x5219;&#x670D;&#x52A1;&#x4E5F;&#x4F1A;&#x88AB;&#x7EC8;&#x6B62;&#xFF09;</strong>&#xFF1A;<br><img src="http://cdn.tiimor.cn/images/Artifactory%E8%BF%90%E8%A1%8C%E6%88%90%E5%8A%9F.png" alt="Artifactory&#x8FD0;&#x884C;&#x6210;&#x529F;" title="Artifactory&#x8FD0;&#x884C;&#x6210;&#x529F;"></p>
</li>
</ul>
<h2 id="Service-Installation"><a href="#Service-Installation" class="headerlink" title="Service Installation"></a>Service Installation</h2><p>&#x540E;&#x53F0;&#x542F;&#x52A8;&#xFF0C;&#x4E0D;&#x9700;&#x8981;&#x5728;&#x670D;&#x52A1;&#x8FD0;&#x884C;&#x671F;&#x95F4;&#x6253;&#x5F00;&#x63A7;&#x5236;&#x53F0;&#xFF0C;&#x5373;<strong>&#x53EF;&#x4EE5;&#x5173;&#x95ED;&#x670D;&#x52A1;&#x7684;&#x63A7;&#x5236;&#x53F0;</strong>&#x3002;</p>
<ul>
<li>&#x5B89;&#x88C5;&#x670D;&#x52A1;<ol>
<li>Windows&#x4E0A;&#x6267;&#x884C;<code>installService.bat</code>&#x811A;&#x672C;</li>
<li>Linux&#x4E0A;&#x6267;&#x884C;<code>./installService.sh</code>&#xFF0C;&#x9700;&#x8981;<strong>root&#x6743;&#x9650;</strong></li>
</ol>
</li>
</ul>
<ul>
<li>&#x542F;&#x52A8;&#x670D;&#x52A1;<ol>
<li>Windows&#x4E0A;&#x63A7;&#x5236;&#x53F0;&#x6267;&#x884C;&#x547D;&#x4EE4;<code>sc start Artifactory</code></li>
<li>Linux&#x4E0A;&#x6267;&#x884C;&#x547D;&#x4EE4;<code>service artifactory start</code></li>
</ol>
</li>
</ul>
<ul>
<li>&#x76F8;&#x5173;&#x547D;&#x4EE4;  <figure class="highlight stylus"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">Windows&#xFF1A;</span><br><span class="line">	sc stop Artifactory	<span class="comment">// &#x505C;&#x6B62;&#x670D;&#x52A1;</span></span><br><span class="line">	sc query Artifactory	<span class="comment">// &#x68C0;&#x67E5;&#x670D;&#x52A1;&#x72B6;&#x6001;&#xFF0C;&#x68C0;&#x6D4B;&#x670D;&#x52A1;&#x662F;&#x5426;&#x8FD0;&#x884C;&#x6216;&#x68C0;&#x6D4B;&#x8FD0;&#x884C;&#x72B6;&#x6001;</span></span><br><span class="line">	uninstallService<span class="selector-class">.bat</span>	<span class="comment">// &#x5378;&#x8F7D;&#x670D;&#x52A1;</span></span><br><span class="line"></span><br><span class="line">Linux:</span><br><span class="line">	service artifactory check 	 		<span class="comment">// &#x68C0;&#x67E5;&#x670D;&#x52A1;&#x72B6;&#x6001;&#xFF0C;&#x68C0;&#x6D4B;&#x670D;&#x52A1;&#x662F;&#x5426;&#x8FD0;&#x884C;&#x6216;&#x68C0;&#x6D4B;&#x8FD0;&#x884C;&#x72B6;&#x6001;</span></span><br><span class="line">	service artifactory stop  			<span class="comment">// &#x505C;&#x6B62;&#x670D;&#x52A1;</span></span><br><span class="line">	tail -f  <span class="variable">$ARTIFACTORY_HOME</span>/logs/artifactory<span class="selector-class">.log</span> <span class="comment">// &#x67E5;&#x770B;Artifactory&#x65E5;&#x5FD7;</span></span><br><span class="line">	./uninstallService<span class="selector-class">.sh</span>				<span class="comment">// &#x5378;&#x8F7D;&#x670D;&#x52A1;</span></span><br></pre></td></tr></tbody></table></figure>
</li>
</ul>
<p>&#x4F7F;&#x7528;&#x8BE5;&#x65B9;&#x5F0F;&#x542F;&#x52A8;&#x670D;&#x52A1;&#x540E;&#xFF0C;&#x8D26;&#x53F7;&#x5BC6;&#x7801;&#x5DF2;&#x9ED8;&#x8BA4;&#x4E3A;<strong>admin&#x548C;password</strong>&#xFF1B;&#x63A5;&#x4E0B;&#x6765;&#x7684;&#x6B65;&#x9AA4;&#x4E0E;Manual Installation&#x65B9;&#x5F0F;&#x57FA;&#x672C;&#x4E00;&#x81F4;&#xFF0C;&#x53EA;&#x662F;&#x4E0D;&#x7528;&#x8BBE;&#x7F6E;&#x8D26;&#x53F7;&#x5BC6;&#x7801;&#x3002;</p>
<h2 id="&#x670D;&#x52A1;&#x521D;&#x59CB;&#x5316;"><a href="#&#x670D;&#x52A1;&#x521D;&#x59CB;&#x5316;" class="headerlink" title="&#x670D;&#x52A1;&#x521D;&#x59CB;&#x5316;"></a>&#x670D;&#x52A1;&#x521D;&#x59CB;&#x5316;</h2><ul>
<li><p>Manual Installation&#x7684;&#x542F;&#x52A8;&#x65B9;&#x5F0F;&#x4E0D;&#x8981;&#x5173;&#x95ED;&#x63A7;&#x5236;&#x7A97;&#x53E3;&#xFF0C;&#x5173;&#x95ED;&#x540E;&#x672C;&#x5730;&#x4ED3;&#x5E93;&#x4E5F;&#x4F1A;&#x5173;&#x95ED;&#xFF1B;Service Installation&#x53EF;&#x4EE5;&#x5173;&#x95ED;&#x63A7;&#x5236;&#x7A97;&#x53E3;&#x3002;&#x6253;&#x5F00;&#x672C;&#x5730;&#x4ED3;&#x5E93;&#xFF1A;<a href="http://localhost:8081/artifactory" target="_blank" rel="noopener">http://localhost:8081/artifactory</a> &#xFF0C;&#x9996;&#x6B21;&#x8FDB;&#x5165;&#x9700;&#x8981;<strong>&#x8BBE;&#x7F6E;&#x7BA1;&#x7406;&#x5458;&#x5BC6;&#x7801;</strong>&#xFF0C;&#x8BBE;&#x7F6E;&#x5B8C;&#x6210;&#x540E;&#xFF0C;&#x53EF;&#x8DF3;&#x8FC7;&#x5176;&#x4ED6;&#x7684;&#x8BBE;&#x7F6E;&#xFF0C;&#x53EF;&#x4EE5;&#x5728;&#x540E;&#x9762;&#x518D;&#x521B;&#x5EFA;&#x4ED3;&#x5E93;&#x3002;<br><img src="http://cdn.tiimor.cn/images/%E6%89%93%E5%BC%80%E6%9C%AC%E5%9C%B0%E4%BB%93%E5%BA%93.png" alt="&#x6253;&#x5F00;&#x672C;&#x5730;&#x4ED3;&#x5E93;"></p>
</li>
<li><p>&#x8F93;&#x5165;&#x8D26;&#x53F7;&#xFF1A;admin&#xFF0C;&#x5BC6;&#x7801;&#xFF1A;password&#xFF0C;&#x767B;&#x5F55;<br><img src="http://cdn.tiimor.cn/images/Artifactory%E7%99%BB%E5%BD%95%E6%88%90%E5%8A%9F.png" alt="Artifactory&#x767B;&#x5F55;&#x6210;&#x529F;" title="&#x767B;&#x5F55;&#x6210;&#x529F;"></p>
</li>
<li><p>&#x521B;&#x5EFA;Library&#x4ED3;&#x5E93;&#xFF0C;&#x5982;&#x679C;&#x9009;&#x62E9;gradle&#xFF0C;&#x4F1A;&#x751F;&#x6210;&#x4E0B;&#x9762;4&#x4E2A;Repository&#xFF1A;<br><img src="http://cdn.tiimor.cn/images/gradle%E4%BB%93%E5%BA%93.png" alt="gradle&#x4ED3;&#x5E93;" title="&#x521B;&#x5EFA;gradle&#x4ED3;&#x5E93;"></p>
</li>
</ul>
<h1 id="&#x53D1;&#x5E03;Library&#x5230;&#x672C;&#x5730;&#x4ED3;&#x5E93;"><a href="#&#x53D1;&#x5E03;Library&#x5230;&#x672C;&#x5730;&#x4ED3;&#x5E93;" class="headerlink" title="&#x53D1;&#x5E03;Library&#x5230;&#x672C;&#x5730;&#x4ED3;&#x5E93;"></a>&#x53D1;&#x5E03;Library&#x5230;&#x672C;&#x5730;&#x4ED3;&#x5E93;</h1><ul>
<li><p>&#x6253;&#x5F00;AndroidStudio&#xFF0C;&#x65B0;&#x5EFA;Library&#x7C7B;&#x578B;&#x7684;Module<br><img src="http://cdn.tiimor.cn/images/ArtifactoryLibraryModule.png" alt="ArtifactoryLibraryModule"></p>
</li>
<li><p>&#x914D;&#x7F6E;&#x9879;&#x76EE;build.gradle</p>
<figure class="highlight gradle"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">buildscript</span> {</span><br><span class="line">    <span class="keyword">repositories</span> {</span><br><span class="line">        jcenter()</span><br><span class="line">    }</span><br><span class="line">    <span class="keyword">dependencies</span> {</span><br><span class="line">        <span class="keyword">classpath</span> <span class="string">&apos;com.android.tools.build:gradle:2.2.3&apos;</span></span><br><span class="line">        <span class="comment">// &#x6DFB;&#x52A0;</span></span><br><span class="line">        <span class="keyword">classpath</span> <span class="string">&quot;org.jfrog.buildinfo:build-info-extractor-gradle:4+&quot;</span></span><br><span class="line">        <span class="comment">// <span class="doctag">NOTE:</span> Do not place your application dependencies here; they belong</span></span><br><span class="line">        <span class="comment">// in the individual module build.gradle files</span></span><br><span class="line">    }</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="keyword">allprojects</span> {</span><br><span class="line">    <span class="keyword">repositories</span> {</span><br><span class="line">        jcenter()</span><br><span class="line">    }</span><br><span class="line">}</span><br></pre></td></tr></tbody></table></figure>
</li>
<li><p>&#x914D;&#x7F6E;LibraryModule&#x7684;build.gradle</p>
<figure class="highlight gradle"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br></pre></td><td class="code"><pre><span class="line">apply plugin: <span class="string">&apos;com.android.library&apos;</span></span><br><span class="line"><span class="comment">/*** apply plugin ***/</span></span><br><span class="line"><span class="comment">// &#x6DFB;&#x52A0;</span></span><br><span class="line">apply plugin: <span class="string">&apos;com.jfrog.artifactory&apos;</span></span><br><span class="line"><span class="comment">// &#x6DFB;&#x52A0;</span></span><br><span class="line">apply plugin: <span class="string">&apos;maven-publish&apos;</span></span><br><span class="line"></span><br><span class="line">android {</span><br><span class="line">    compileSdkVersion <span class="number">25</span></span><br><span class="line">    buildToolsVersion <span class="string">&quot;25.0.2&quot;</span></span><br><span class="line"></span><br><span class="line">    defaultConfig {</span><br><span class="line">        minSdkVersion <span class="number">15</span></span><br><span class="line">        targetSdkVersion <span class="number">25</span></span><br><span class="line">        versionCode <span class="number">1</span></span><br><span class="line">        versionName <span class="string">&quot;1.0&quot;</span></span><br><span class="line"></span><br><span class="line">        testInstrumentationRunner <span class="string">&quot;android.support.test.runner.AndroidJUnitRunner&quot;</span></span><br><span class="line"></span><br><span class="line">    }</span><br><span class="line">    buildTypes {</span><br><span class="line">        release {</span><br><span class="line">            minifyEnabled <span class="keyword">false</span></span><br><span class="line">            proguardFiles getDefaultProguardFile(<span class="string">&apos;proguard-android.txt&apos;</span>), <span class="string">&apos;proguard-rules.pro&apos;</span></span><br><span class="line">        }</span><br><span class="line">    }</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="keyword">dependencies</span> {</span><br><span class="line">    <span class="keyword">compile</span> <span class="keyword">fileTree</span>(dir: <span class="string">&apos;libs&apos;</span>, <span class="keyword">include</span>: [<span class="string">&apos;*.jar&apos;</span>])</span><br><span class="line">    androidTestCompile(<span class="string">&apos;com.android.support.test.espresso:espresso-core:2.2.2&apos;</span>, {</span><br><span class="line">        <span class="keyword">exclude</span> <span class="keyword">group</span>: <span class="string">&apos;com.android.support&apos;</span>, module: <span class="string">&apos;support-annotations&apos;</span></span><br><span class="line">    })</span><br><span class="line">    <span class="keyword">compile</span> <span class="string">&apos;com.android.support:appcompat-v7:25.3.1&apos;</span></span><br><span class="line">    testCompile <span class="string">&apos;junit:junit:4.12&apos;</span></span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="comment">// &#x751F;&#x6210;&#x6E90;&#x7801;&#x4EFB;&#x52A1;</span></span><br><span class="line"><span class="keyword">task</span> sourcesJar(type: Jar) {</span><br><span class="line">    <span class="keyword">from</span> android.<span class="keyword">sourceSets</span>.main.java.srcDirs</span><br><span class="line">    classifier = <span class="string">&apos;sources&apos;</span></span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="comment">// &#x751F;&#x6210;Javadoc&#x4EFB;&#x52A1;</span></span><br><span class="line"><span class="keyword">task</span> javadoc(type: Javadoc) {</span><br><span class="line">    <span class="keyword">source</span> = android.<span class="keyword">sourceSets</span>.main.java.srcDirs</span><br><span class="line">    <span class="keyword">classpath</span> += <span class="keyword">project</span>.files(android.getBootClasspath().<span class="keyword">join</span>(<span class="keyword">File</span>.pathSeparator))</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="keyword">task</span> javadocJar(type: Jar, dependsOn: javadoc) {</span><br><span class="line">    classifier = <span class="string">&apos;javadoc&apos;</span></span><br><span class="line">    <span class="keyword">from</span> javadoc.<span class="keyword">destinationDir</span></span><br><span class="line">}</span><br><span class="line"></span><br><span class="line">javadoc {</span><br><span class="line">    <span class="keyword">options</span>{</span><br><span class="line">        encoding <span class="string">&quot;UTF-8&quot;</span></span><br><span class="line">        charSet <span class="string">&apos;UTF-8&apos;</span></span><br><span class="line">        author <span class="keyword">true</span></span><br><span class="line">        version <span class="keyword">true</span></span><br><span class="line">        links <span class="string">&quot;http://docs.oracle.com/javase/7/docs/api&quot;</span></span><br><span class="line">    }</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="comment">/*** &#x4E0A;&#x4F20;&#x6E90;&#x7801; ***/</span></span><br><span class="line"><span class="keyword">artifacts</span> {</span><br><span class="line">    archives javadocJar</span><br><span class="line">    archives sourcesJar</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="comment">/*** &#x6DFB;&#x52A0; ***/</span></span><br><span class="line"><span class="comment">// &#x672C;&#x5730;&#x4ED3;&#x5E93;&#x5730;&#x5740;</span></span><br><span class="line"><span class="keyword">def</span> MAVEN_LOCAL_PATH = <span class="string">&apos;http://localhost:8081/artifactory&apos;</span></span><br><span class="line"><span class="comment">// &#x9879;&#x76EE;&#x540D;&#x79F0;[&#x53EF;&#x4FEE;&#x6539;]</span></span><br><span class="line"><span class="keyword">def</span> ARTIFACT_ID = <span class="string">&apos;jfrog&apos;</span></span><br><span class="line"><span class="comment">// &#x53D1;&#x5E03;&#x7684;&#x7248;&#x672C;[&#x53EF;&#x4FEE;&#x6539;]</span></span><br><span class="line"><span class="keyword">def</span> VERSION_NAME = <span class="string">&apos;1.0.0&apos;</span></span><br><span class="line"><span class="comment">// jcenter&#x4E0A;&#x7684;&#x8DEF;&#x5F84;[&#x53EF;&#x4FEE;&#x6539;]</span></span><br><span class="line"><span class="keyword">def</span> GROUP_ID = <span class="string">&apos;com.excellence&apos;</span></span><br><span class="line"></span><br><span class="line"><span class="comment">/*** setting pom ***/</span></span><br><span class="line">publishing {</span><br><span class="line">    publications {</span><br><span class="line">        aar(MavenPublication) {</span><br><span class="line">            groupId GROUP_ID</span><br><span class="line">            version = VERSION_NAME</span><br><span class="line">            artifactId ARTIFACT_ID</span><br><span class="line">            <span class="comment">// Tell maven to prepare the generated &quot;*.aar&quot; and source file for publishing</span></span><br><span class="line">            artifact(<span class="string">&quot;$buildDir/outputs/aar/${project.getName()}-release.aar&quot;</span>)</span><br><span class="line">            artifact javadocJar</span><br><span class="line">            artifact sourcesJar			</span><br><span class="line">	    pom.withXml {</span><br><span class="line">                <span class="keyword">def</span> <span class="keyword">dependencies</span> = asNode().appendNode(<span class="string">&apos;dependencies&apos;</span>)</span><br><span class="line">                <span class="keyword">configurations</span>.<span class="keyword">compile</span>.allDependencies.<span class="keyword">each</span> {</span><br><span class="line">                    <span class="comment">// &#x5982;&#x679C;&#x6709;compile fileTree()&#xFF0C;group&#x4F1A;&#x4E3A;&#x7A7A;&#xFF0C;&#x9700;&#x8981;&#x53BB;&#x9664;</span></span><br><span class="line">                    <span class="keyword">if</span> (it.<span class="keyword">group</span> != <span class="keyword">null</span>) {</span><br><span class="line">                        <span class="keyword">def</span> dependency = <span class="keyword">dependencies</span>.appendNode(<span class="string">&apos;dependency&apos;</span>)</span><br><span class="line">                        dependency.appendNode(<span class="string">&apos;groupId&apos;</span>, it.<span class="keyword">group</span>)</span><br><span class="line">                        dependency.appendNode(<span class="string">&apos;artifactId&apos;</span>, it.name)</span><br><span class="line">                        dependency.appendNode(<span class="string">&apos;version&apos;</span>, it.version)</span><br><span class="line">                    }</span><br><span class="line">                }</span><br><span class="line">            }</span><br><span class="line">        }</span><br><span class="line">    }</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="comment">/*** setting artifactorypublish ***/</span></span><br><span class="line">artifactory {</span><br><span class="line">    contextUrl = MAVEN_LOCAL_PATH</span><br><span class="line">    publish {</span><br><span class="line">        repository {</span><br><span class="line">            <span class="comment">/**</span></span><br><span class="line"><span class="comment">             * repoKey:&#x6307;&#x5B9A;&#x53D1;&#x5E03;&#x5230;&#x7684;&#x4ED3;&#x5E93;&#x540D;&#x79F0;[&#x53EF;&#x4FEE;&#x6539;]</span></span><br><span class="line"><span class="comment">             */</span></span><br><span class="line">            <span class="comment">// The Artifactory repository key to publish to</span></span><br><span class="line">            repoKey = <span class="string">&apos;gradle-release-local&apos;</span></span><br><span class="line">            <span class="comment">// &#x53D1;&#x5E03;&#x8005;&#x7528;&#x6237;&#x540D;[&#x53EF;&#x4FEE;&#x6539;]</span></span><br><span class="line">            username = <span class="string">&quot;admin&quot;</span></span><br><span class="line">            <span class="comment">// &#x53D1;&#x5E03;&#x8005;&#x5BC6;&#x7801;[&#x53EF;&#x4FEE;&#x6539;]</span></span><br><span class="line">            password = <span class="string">&quot;password&quot;</span></span><br><span class="line">        }</span><br><span class="line">        defaults {</span><br><span class="line">            <span class="comment">// &#x8FD9;&#x91CC;&#x7684;&apos;aar&apos;&#x5BF9;&#x5E94;publishing&#x4EFB;&#x52A1;&#x4E2D;&#x7684;&apos;aar&apos;,&#x4EFB;&#x52A1;&#x540D;&#x79F0;&#x53EF;&#x81EA;&#x5B9A;&#x4E49;</span></span><br><span class="line">            <span class="comment">// Tell the Artifactory Plugin which artifacts should be published to Artifactory.</span></span><br><span class="line">            publications(<span class="string">&apos;aar&apos;</span>)</span><br><span class="line">            publishArtifacts = <span class="keyword">true</span></span><br><span class="line">            <span class="comment">// Properties to be attached to the published artifacts.</span></span><br><span class="line">            properties = [<span class="string">&apos;qa.level&apos;</span>: <span class="string">&apos;basic&apos;</span>, <span class="string">&apos;dev.team&apos;</span>: <span class="string">&apos;core&apos;</span>]</span><br><span class="line">            <span class="comment">// Publish generated POM files to Artifactory (true by default)</span></span><br><span class="line">            publishPom = <span class="keyword">true</span></span><br><span class="line">        }</span><br><span class="line">    }</span><br><span class="line">}</span><br></pre></td></tr></tbody></table></figure>
<p>  &#x8FD9;&#x91CC;&#x4EC5;&#x4EC5;&#x662F;&#x7B80;&#x5355;&#x7684;&#x914D;&#x7F6E;&#x4F7F;&#x7528;&#xFF0C;&#x5F53;&#x7136;&#x4F60;&#x4E5F;&#x53EF;&#x4EE5;&#x67E5;&#x4E9B;&#x9AD8;&#x7EA7;&#x7684;&#x4F7F;&#x7528;&#xFF0C;&#x6BD4;&#x5982;&#x5728; gradle.properties&#x4E2D;&#x8FDB;&#x884C;&#x914D;&#x7F6E;&#x7684;&#x5B89;&#x5168;&#x6027;&#x505A;&#x6CD5;&#xFF0C;&#x8FD9;&#x91CC;&#x5C31;&#x4E0D;&#x6DF1;&#x5165;&#x4E86;&#x3002;</p>
<figure class="highlight ini"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">artifactory_user</span>=<span class="variable">${security.getCurrentUsername()}</span></span><br><span class="line"><span class="attr">artifactory_password</span>=<span class="variable">${security.getEncryptedPassword()!&quot;insert password&quot;}</span></span><br><span class="line"><span class="attr">artifactory_contextUrl</span>=http://localhost:<span class="number">8081</span>/artifactory</span><br></pre></td></tr></tbody></table></figure>
</li>
<li><p><strong>&#x8BF4;&#x660E;</strong></p>
<ul>
<li>&#x5728;&#x8FD9;&#x91CC;&#x4E0A;&#x4F20;&#x7684;&#x4E8B; release.aar &#x5305;&#xFF0C;&#x6545;&#x6267;&#x884C;&#x547D;&#x4EE4;&#x7684;&#x65F6;&#x5019;&#x9700;&#x8981;&#x6267;&#x884C;release&#x6253;&#x5305;</li>
<li>artifactory/publish/repository/repokey &#x662F;&#x4F60;&#x8981;&#x4E0A;&#x4F20;&#x7684;respository&#x540D;&#x79F0;&#xFF0C;&#x5F53;&#x7136;&#x53EF;&#x4EE5;&#x65B0;&#x5EFA;&#xFF0C;&#x8FD9;&#x91CC;&#x6211;&#x4EEC;&#x5EFA;&#x7ACB;&#x7684;&#x662F;gradle&#x4ED3;&#x5E93;&#xFF0C;&#x4E0A;&#x4F20;&#x7684;&#x4ED3;&#x5E93;&#x662F;gradle-release-local</li>
</ul>
</li>
</ul>
<ul>
<li><p><strong>&#x4E09;&#x79CD;&#x65B9;&#x5F0F;&#x4E0A;&#x4F20;</strong></p>
<ul>
<li><p>&#x64CD;&#x4F5C;&#x4E0A;&#x4F20;<br>&#x70B9;&#x51FB;&#x6253;&#x5F00;Gradle projects&#xFF0C;&#x8FDB;&#x5165;Module&#x7684;Tasks&#x4E2D;&#xFF0C;<strong>&#x987A;&#x5E8F;</strong>&#x6267;&#x884C;&#x4E0B;&#x9762;&#x6B65;&#x9AA4;</p>
<figure class="highlight xl"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="function"><span class="title">build</span>&#x76EE;&#x5F55;-&gt;</span>&#x53CC;&#x51FB;assembleRelease : &#x6253;release &#x5305;</span><br><span class="line"><span class="function"><span class="title">publishing</span>&#x76EE;&#x5F55;-&gt;</span>&#x53CC;&#x51FB;generatePomFileForAarPublication &#xFF1A; &#x751F;&#x6210; pom.xml &#x6587;&#x4EF6;</span><br><span class="line"><span class="function"><span class="title">publishing</span>&#x76EE;&#x5F55;-&gt;</span>&#x53CC;&#x51FB;artifactoryPublish &#xFF1A;&#x4E0A;&#x4F20;</span><br></pre></td></tr></tbody></table></figure>
<p><img src="http://cdn.tiimor.cn/images/Artifactory%E4%B8%8A%E4%BC%A0.png" alt="Artifactory&#x4E0A;&#x4F20;"></p>
</li>
<li><p>&#x547D;&#x4EE4;&#x4E0A;&#x4F20;<br>&#x4ECE;Terminal&#x63A7;&#x5236;&#x53F0;&#x8FDB;&#x5165;&#x5230;Module&#x4E2D;&#xFF0C;&#x6267;&#x884C;&#x547D;&#x4EE4;</p>
<figure class="highlight ebnf"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attribute">gradle assembleRelease generatePomFileForAarPublication artifactoryPublish</span></span><br></pre></td></tr></tbody></table></figure>
<p><img src="http://cdn.tiimor.cn/images/Artifactory%E4%B8%8A%E4%BC%A0%E6%88%90%E5%8A%9F.png" alt="Artifactory&#x4E0A;&#x4F20;&#x6210;&#x529F;" title="&#x4E0A;&#x4F20;&#x6210;&#x529F;"></p>
</li>
<li><p>&#x4FDD;&#x5BC6;&#x547D;&#x4EE4;&#x4E0A;&#x4F20;&#xFF0C;&#x5373;&#x540C;&#x547D;&#x4EE4;&#x4E0A;&#x4F20;&#x4E00;&#x81F4;&#xFF0C;&#x4F46;&#x662F;&#x4E0D;&#x6CC4;&#x9732;&#x7528;&#x6237;&#x548C;&#x5BC6;&#x7801;<br>&#x4FEE;&#x6539;&#x4F9D;&#x8D56;&#x9879;&#x76EE;&#x4E2D;&#x7684;build.gradle&#x6587;&#x4EF6;&#xFF0C;&#x4F7F;&#x7528;&#x53C2;&#x6570;&#x66FF;&#x4EE3;username&#x548C;password&#xFF0C;&#x6B64;&#x65F6;&#x7F16;&#x8BD1;&#x4E0D;&#x901A;&#x8FC7;&#xFF0C;&#x56E0;&#x4E3A;&#x53C2;&#x6570;&#x662F;&#x901A;&#x8FC7;&#x547D;&#x4EE4;&#x4F20;&#x5165;&#x7684;&#xFF0C;&#x5982;<br><img src="http://cdn.tiimor.cn/images/Artifactory%E4%BF%9D%E5%AF%86%E4%B8%8A%E4%BC%A0.png" alt="Artifactory&#x4FDD;&#x5BC6;&#x4E0A;&#x4F20;"><br>&#x7136;&#x540E;&#x6267;&#x884C;&#x547D;&#x4EE4;</p>
<figure class="highlight routeros"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">gradle <span class="attribute">-Puser</span>=&#x7528;&#x6237;&#x540D; <span class="attribute">-Ppwd</span>=&#x5BC6;&#x7801; assembleRelease generatePomFileForAarPublication artifactoryPublish</span><br></pre></td></tr></tbody></table></figure>
</li>
</ul>
</li>
<li><p><strong>&#x7248;&#x672C;&#x66F4;&#x65B0;</strong><br>&#x4FEE;&#x6539;LibraryModule&#x4E2D;&#x7684;VERSION_NAME&#xFF0C;&#x7136;&#x540E;&#x91CD;&#x65B0;&#x4E0A;&#x4F20;&#x5373;&#x53EF;<br><img src="http://cdn.tiimor.cn/images/Artifactory%E6%9B%B4%E6%96%B0%E7%89%88%E6%9C%AC.png" alt="Artifactory&#x66F4;&#x65B0;&#x7248;&#x672C;" title="&#x7248;&#x672C;&#x66F4;&#x65B0;"></p>
</li>
</ul>
<h1 id="&#x9879;&#x76EE;&#x5F15;&#x7528;Library"><a href="#&#x9879;&#x76EE;&#x5F15;&#x7528;Library" class="headerlink" title="&#x9879;&#x76EE;&#x5F15;&#x7528;Library"></a>&#x9879;&#x76EE;&#x5F15;&#x7528;Library</h1><ul>
<li><p>&#x914D;&#x7F6E;&#x9879;&#x76EE;build.gradle</p>
<figure class="highlight dts"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="class">allprojects </span>{</span><br><span class="line">	<span class="class">repositories </span>{</span><br><span class="line">		jcenter()</span><br><span class="line">		<span class="comment">// &#x6DFB;&#x52A0;&#x4ED3;&#x5E93;&#x5730;&#x5740;</span></span><br><span class="line">		<span class="class">maven </span>{ url <span class="string">&quot;http://localhost:8081/artifactory/gradle-release-local/&quot;</span> }</span><br><span class="line">	}</span><br><span class="line">}</span><br></pre></td></tr></tbody></table></figure>
</li>
<li><p>&#x914D;&#x7F6E;&#x5DE5;&#x7A0B;Module&#x7684;build.gradle</p>
<figure class="highlight gradle"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">compile</span> <span class="string">&apos;com.excellence:jfrog:1.0.0&apos;</span></span><br></pre></td></tr></tbody></table></figure>
<p>  &#x57FA;&#x672C;&#x7EC4;&#x6210;&#xFF1A;</p>
<figure class="highlight css"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-tag">group_id</span><span class="selector-pseudo">:artifact_Id</span><span class="selector-pseudo">:version_name</span></span><br></pre></td></tr></tbody></table></figure>
<ul>
<li>group_id : com.excellence</li>
<li>artifact_id : jfrog</li>
<li>version_name: 1.0.0</li>
</ul>
</li>
</ul>
<p><img src="http://cdn.tiimor.cn/images/Artifactory%E5%BC%95%E7%94%A8%E4%BE%9D%E8%B5%96.png" alt="Artifactory&#x5F15;&#x7528;&#x4F9D;&#x8D56;" title="&#x5F15;&#x7528;&#x6210;&#x529F;"></p>
<script>
        document.querySelectorAll('.github-emoji')
          .forEach(el => {
            if (!el.dataset.src) { return; }
            const img = document.createElement('img');
            img.style = 'display:none !important;';
            img.src = el.dataset.src;
            img.addEventListener('error', () => {
              img.remove();
              el.style.color = 'inherit';
              el.style.backgroundImage = 'none';
              el.style.background = 'none';
            });
            img.addEventListener('load', () => {
              img.remove();
            });
            document.body.appendChild(img);
          });
      </script>
      
    </div>
    
    
    

    

    
      <div>
        <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
  <div>谢谢老板，请尽情用红包来蹂躏我吧！！！</div>
  <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
    <span>赏</span>
  </button>
  <div id="QR" style="display: none;">

    
      <div id="wechat" style="display: inline-block">
        <img id="wechat_qr" src="/uploads/wechatpay.jpg" alt="Tiimor 微信打赏">
        <p>微信打赏</p>
      </div>
    

    
      <div id="alipay" style="display: inline-block">
        <img id="alipay_qr" src="/uploads/alipay.jpg" alt="Tiimor 支付宝打赏">
        <p>支付宝打赏</p>
      </div>
    

    

  </div>
</div>

      </div>
    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <!-- modify by zhangwei -->
            <!-- 文章底部标签图标 -->
            <a href="/tags/gradle/" rel="tag"><i class="menu-item-icon fa fa-tag fa-fw"></i>gradle</a>
          
            <!-- modify by zhangwei -->
            <!-- 文章底部标签图标 -->
            <a href="/tags/JFrog/" rel="tag"><i class="menu-item-icon fa fa-tag fa-fw"></i>JFrog</a>
          
            <!-- modify by zhangwei -->
            <!-- 文章底部标签图标 -->
            <a href="/tags/Artifactory/" rel="tag"><i class="menu-item-icon fa fa-tag fa-fw"></i>Artifactory</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/Android青铜篇-shape/" rel="next" title="Android青铜篇-shape">
                <i class="fa fa-chevron-left"></i> Android青铜篇-shape
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/Android青铜篇-XMLDrawable/" rel="prev" title="Android青铜篇-XMLDrawable">
                Android青铜篇-XMLDrawable <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  
    <div class="comments" id="comments">
      
        <div id="gitment-container"></div>
      
    </div>

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image" src="/uploads/avatar.jpg" alt="Tiimor">
            
              <p class="site-author-name" itemprop="name">Tiimor</p>
              <p class="site-description motion-element" itemprop="description">安静地做一只攻城狮。</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">41</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/categories/index.html">
                  <span class="site-state-item-count">6</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/tags/index.html">
                  <span class="site-state-item-count">56</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          
            <div class="feed-link motion-element">
              <a href="/atom.xml" rel="alternate">
                <i class="fa fa-rss"></i>
                RSS
              </a>
            </div>
          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/VeiZhang" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-github"></i>GitHub</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="http://www.weibo.com/tiimor" target="_blank" title="微博">
                      
                        <i class="fa fa-fw fa-weibo"></i>微博</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://juejin.im/user/589972d0570c3500624fd791" target="_blank" title="掘金">
                      
                        <i class="fa fa-fw fa-anchor"></i>掘金</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="http://www.jianshu.com/u/93b886580243" target="_blank" title="简书">
                      
                        <i class="fa fa-fw fa-book"></i>简书</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="http://wpa.qq.com/msgrd?v=3&uin=690393541&site=qq&menu=yes" target="_blank" title="QQ">
                      
                        <i class="fa fa-fw fa-qq"></i>QQ</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="mailto:tiimor@qq.com" target="_blank" title="邮箱">
                      
                        <i class="fa fa-fw fa-envelope"></i>邮箱</a>
                  </span>
                
            </div>
          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#搭建环境"><span class="nav-number">1.</span> <span class="nav-text">搭建环境</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#启动服务"><span class="nav-number">2.</span> <span class="nav-text">启动服务</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#Manual-Installation"><span class="nav-number">2.1.</span> <span class="nav-text">Manual Installation</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Service-Installation"><span class="nav-number">2.2.</span> <span class="nav-text">Service Installation</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#服务初始化"><span class="nav-number">2.3.</span> <span class="nav-text">服务初始化</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#发布Library到本地仓库"><span class="nav-number">3.</span> <span class="nav-text">发布Library到本地仓库</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#项目引用Library"><span class="nav-number">4.</span> <span class="nav-text">项目引用Library</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; 2017 &mdash; <span itemprop="copyrightYear">2019</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Tiimor</span>

  
</div>


  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Pisces</a></div>




        
<div class="busuanzi-count">
  <!-- modify by zhangwei -->
  <!-- 修改不蒜子统计脚本 -->
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>

  
    <span class="site-uv">
      <i class="fa fa-user"></i>
      <span class="busuanzi-value" id="busuanzi_value_site_uv"></span>
      
    </span>
  

  
    <span class="site-pv">
      <i class="fa fa-eye"></i>
      <span class="busuanzi-value" id="busuanzi_value_site_pv"></span>
      
    </span>
  
</div>



<script>
  	var _mtac = {};
  	(function() {
  		var mta = document.createElement("script");
  		mta.src = "https://pingjs.qq.com/h5/stats.js?v2.0.4";
  		mta.setAttribute("name", "MTAH5");
  		mta.setAttribute("sid", "500425805");

  		var s = document.getElementsByTagName("script")[0];
  		s.parentNode.insertBefore(mta, s);
  	})();
</script>


  <script type="text/javascript">
    (function() {
      var hm = document.createElement("script");
      hm.src = "//tajs.qq.com/stats?sId=61441764";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>




        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
          <span id="scrollpercent"><span>0</span>%</span>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  


  











  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  

  
  
    <script type="text/javascript" src="/lib/canvas-nest/canvas-nest.min.js"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  







<!-- LOCAL: You can save these files to your site and update links -->
    
        
        <link rel="stylesheet" href="https://aimingoo.github.io/gitmint/style/default.css">
        <script src="https://aimingoo.github.io/gitmint/dist/gitmint.browser.js"></script>
    
<!-- END LOCAL -->

    

    
      <script type="text/javascript">
      function renderGitment(){
        var gitment = new Gitmint({
            <!-- modify by zhangwei -->
            <!-- 修复gitment评论页初始化错误@tiimor -->
            id: '1495355875000', 
            owner: 'VeiZhang',
            repo: 'veizhang.github.io',
            
            lang: "" || navigator.language || navigator.systemLanguage || navigator.userLanguage,
            
            oauth: {
            
            
                client_secret: '9919bc61413a89ea3eb156910d282e3103093e32',
            
                client_id: 'f08924ca58e61d6f51f4'
            }});
        gitment.render('gitment-container');
      }

      
      renderGitment();
      
      </script>
    







  




  
  
  
  <link rel="stylesheet" href="/lib/algolia-instant-search/instantsearch.min.css">

  
  
  <script src="/lib/algolia-instant-search/instantsearch.min.js"></script>
  

  <script src="/js/src/algolia-search.js?v=5.1.4"></script>



  

  
  <script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.4.js"></script>
  <script>AV.initialize("7aBs9I9Y3PjoN6ueX5J3AYQW-gzGzoHsz", "kboycyzaPNAYcUW8AkF3edeW");</script>
  <script>
    function showTime(Counter) {
      var query = new AV.Query(Counter);
      var entries = [];
      var $visitors = $(".leancloud_visitors");

      $visitors.each(function () {
        entries.push( $(this).attr("id").trim() );
      });

      query.containedIn('url', entries);
      query.find()
        .done(function (results) {
          var COUNT_CONTAINER_REF = '.leancloud-visitors-count';

          if (results.length === 0) {
            $visitors.find(COUNT_CONTAINER_REF).text(0);
            return;
          }

          for (var i = 0; i < results.length; i++) {
            var item = results[i];
            var url = item.get('url');
            var time = item.get('time');
            var element = document.getElementById(url);

            $(element).find(COUNT_CONTAINER_REF).text(time);
          }
          for(var i = 0; i < entries.length; i++) {
            var url = entries[i];
            var element = document.getElementById(url);
            var countSpan = $(element).find(COUNT_CONTAINER_REF);
            if( countSpan.text() == '') {
              countSpan.text(0);
            }
          }
        })
        .fail(function (object, error) {
          console.log("Error: " + error.code + " " + error.message);
        });
    }

    function addCount(Counter) {
      var $visitors = $(".leancloud_visitors");
      var url = $visitors.attr('id').trim();
      var title = $visitors.attr('data-flag-title').trim();
      var query = new AV.Query(Counter);

      query.equalTo("url", url);
      query.find({
        success: function(results) {
          if (results.length > 0) {
            var counter = results[0];
            counter.fetchWhenSave(true);
            counter.increment("time");
            counter.save(null, {
              success: function(counter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(counter.get('time'));
              },
              error: function(counter, error) {
                console.log('Failed to save Visitor num, with error message: ' + error.message);
              }
            });
          } else {
            var newcounter = new Counter();
            /* Set ACL */
            var acl = new AV.ACL();
            acl.setPublicReadAccess(true);
            acl.setPublicWriteAccess(true);
            newcounter.setACL(acl);
            /* End Set ACL */
            newcounter.set("title", title);
            newcounter.set("url", url);
            newcounter.set("time", 1);
            newcounter.save(null, {
              success: function(newcounter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(newcounter.get('time'));
              },
              error: function(newcounter, error) {
                console.log('Failed to create');
              }
            });
          }
        },
        error: function(error) {
          console.log('Error:' + error.code + " " + error.message);
        }
      });
    }

    $(function() {
      var Counter = AV.Object.extend("Counter");
      if ($('.leancloud_visitors').length == 1) {
        addCount(Counter);
      } else if ($('.post-title-link').length > 1) {
        showTime(Counter);
      }
    });
  </script>



  

  
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>


  
  

  

  

  

  
  <!-- modify by zhangwei -->
  <!-- 动态时间小人 -->
  <!-- modify by zhangwei -->
<!-- 动态时间小人 -->
<!-- z-index -1 表示在最底层，不能悬浮也不能点击 -->
<!-- z-index auto 可以点击 -->
<!-- z-index 9999 无限大时，总是在最上层，会影响其他悬浮框 -->
<div id="dg" style="z-index: auto; position: fixed ! important; right: 0px; top: 0px;">  
    <table width 100% style="position: absolute; width:260px; right: 0px; top: 0px;">  
		<div>
			<embed wmode="transparent" src="http://cdn.tiimor.cn/images/dynamic_time.swf" quality="high" bgcolor="#ffffff" width="160" height="70" name="honehoneclock" align="middle" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
		</div>
    </table>  
</div>
  
</body>
</html>
